package com.example.voluntary.domain.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.URL;

import java.time.LocalDateTime;
import java.util.Date;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class VolunteerActivitiesDTO {

    @NotNull(message = "古树ID不能为空")
    @Positive(message = "古树ID必须为正整数")
    private Integer treeId;

    @NotBlank(message = "活动标题不能为空")
    @Size(max = 100, message = "标题长度不能超过100字符")
    private String title;

    @NotBlank(message = "活动描述不能为空")
    @Size(max = 1000, message = "描述长度不能超过1000字符")
    private String description;

    @URL(message = "封面图片需为合法URL")
    @Size(max = 255, message = "URL长度不能超过255字符")
    private String activityImage;

    @NotNull(message = "活动类型不能为空")
    @Min(value = 1, message = "活动类型最小值为1")
    @Max(value = 4, message = "活动类型最大值为4")
    private Integer activityType;

    @NotNull(message = "开始时间不能为空")
    private LocalDateTime startTime;

    @NotNull(message = "结束时间不能为空")
    @Future(message = "结束时间必须为未来时间")
    private LocalDateTime endTime;

    @NotBlank(message = "活动地点不能为空")
    @Size(max = 200, message = "地点长度不能超过200字符")
    private String location;

    /** 开始报名时间*/
    @NotNull(message = "开始报名时间不能为空")
    private LocalDateTime registrationStartTime;

    /** 结束报名时间 */
    @NotNull(message = "结束报名时间不能为空")
    private LocalDateTime registrationEndTime;

    @NotNull(message = "最大参与人数不能为空")
    @PositiveOrZero(message = "最大参与人数不能为负数")
    private Integer maxParticipants;
}
